<template>
	<div id="app">
		<headmain v-if="$route.meta.hidehead!='hidehead'"></headmain>
		<router-view/>
		<aitalk v-show="$route.meta.hideai!='hideai'"/>
	</div>
</template>

<script>
	import headmain from '@/components/headmain'
	import aitalk from '@/components/aitalk'
	export default {
		name: 'app',
		components: {
			headmain,
			aitalk
		},
		data() {
			return {}
		},
		created() {
//			this.windowResize();
//			this.$nextTick(() => {
//				this.setScale();
//			})
		},
		mounted() {
			$('title').text(window.config.VUE_TITLE)
		},
		methods: {
			windowResize() {
				var that = this;
				$(window).unbind('resize');
				$(window).bind('resize', function() {
					that.setScale()
				})
			},
			setScale() {
				var winWidth = $(window).width();
				var scale = 1;
				if(winWidth > 1750) {
					scale = 1;
				} else if(winWidth > 1250) {
					var scale = (winWidth / 1920).toFixed(2);
				} else {
					scale = 0.65;
				}
				$('body').css({
					"zoom": scale,
					"-moz-transform": "scale(" + scale + ")"
				});
				$('.minheight').css({
					"min-height": parseInt(800 / scale) + "px"
				});
			},
		}
	}
</script>